Users/ramacg/refactor managed uploader#455
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the ManagedUploader by simplifying the selectContainers method interface and enhancing the configuration cache to support server-specified refresh intervals.
Key Changes:
- Removed
configurationCacheparameter fromselectContainersmethod, accessing it as a class property instead - Changed
configurationCachevisibility from private to public inContainerUploaderBase - Added logic to use server-specified refresh intervals from configuration responses
- Added comprehensive tests for container selection with different upload methods
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ingest-v2/src/test/resources/config-response.json | New test fixture providing sample configuration with both storage and lake containers |
| ingest-v2/src/test/kotlin/com/microsoft/azure/kusto/ingest/v2/uploader/ManagedUploaderTest.kt | New parameterized test validating container selection logic for DEFAULT, STORAGE, and LAKE upload methods |
| ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/uploader/ManagedUploader.kt | Removed configurationCache parameter from selectContainers method signature |
| ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/uploader/ContainerUploaderBase.kt | Made configurationCache property public and updated selectContainers signature and documentation |
| ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/common/ConfigurationCache.kt | Enhanced to calculate effective refresh interval using minimum of default and server-specified intervals |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/common/ConfigurationCache.kt
Outdated
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/uploader/ContainerUploaderBase.kt
Outdated
Show resolved
Hide resolved
ingest-v2/src/test/kotlin/com/microsoft/azure/kusto/ingest/v2/uploader/ManagedUploaderTest.kt
Show resolved
Hide resolved
ingest-v2/src/main/kotlin/com/microsoft/azure/kusto/ingest/v2/uploader/ContainerUploaderBase.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| LocalTime.parse(configRefreshInterval).toSecondOfDay() * | ||
| 1000L, |
There was a problem hiding this comment.
The refresh interval parsing uses LocalTime.parse() which expects a time format (HH:mm:ss), but the actual format in the config is a TimeSpan/Duration string ("01:00:00"). While "01:00:00" may parse as LocalTime, this is semantically incorrect - you're parsing a duration as a time-of-day. Consider using Duration.parse() with the ISO-8601 duration format (e.g., "PT1H") or implement proper TimeSpan parsing that handles the format correctly.
ingest-v2/src/test/kotlin/com/microsoft/azure/kusto/ingest/v2/uploader/ManagedUploaderTest.kt
Outdated
Show resolved
Hide resolved
a51c91a to
5000240
Compare
…uploader/ContainerUploaderBase.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…uploader/ContainerUploaderBase.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
4617c4d to
4f991dc
Compare
…uploader/ManagedUploaderTest.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add tests for duration
No description provided.